package cn.ithers.blog.service;

import cn.ithers.blog.dto.*;
import cn.ithers.blog.pojo.User;
import cn.ithers.blog.response.ResponseResult;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author: zhanghuan
 * @date: 2020/8/28 18:24
 * @description:
 */

public interface IUserService {

    ResponseResult initManagerAccount(InitUserDTO initUserDTO, HttpServletRequest request);

    void createCaptcha(HttpServletResponse response, String captchaKey) throws Exception;

    ResponseResult sendEmail(String type, HttpServletRequest request, String emailAddress) throws MessagingException;

    ResponseResult register(RegisterUserDTO registerUserDTO, String emailCode, String captchaCode, String captchaKey, HttpServletRequest request);

    ResponseResult doLogin(String captcha, String captchaKey, LoginUserDTO loginUserDTO, String from);

    User checkUser();

    ResponseResult getUserInfo(String userId);

    ResponseResult checkEmail(String email);

    ResponseResult checkUserName(String userName);

    ResponseResult updateUserInfo(String userId, UpdateInfoUserDTO updateInfoUserDTO);

    ResponseResult deleteUserById(String userId);

    ResponseResult listUsers(int page, int pageSize);

    ResponseResult updateUserPassword(String verifyCode, UpdatePasswordUserDTO updatePasswordUserDTO);

    ResponseResult updateEmail(String email, String verifyCode);

    ResponseResult doLogOut();

    String createToken(HttpServletResponse response, User userFromDb, String from);

    HttpServletRequest getRequest();

    HttpServletResponse getResponse();

}
